AppSeeder.run   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 14
c 0
b 0
f 0
rs 9.9
cc 1
1
import { Seeder } from '@concepta/typeorm-seeding';
2
import { User } from 'src/Domain/HumanResource/User/User.entity';
3
import { UserFactory } from '../Factories/UserFactory';
4
5
import { UserSeeder } from './UserSeeder';
6
import { CustomerSeeder } from './CustomerSeeder';
7
import { CustomerFactory } from '../Factories/CustomerFactory';
8
9
export class AppSeeder extends Seeder {
10
  async run() {
11
    const userSeeder = new UserSeeder({
12
      factories: [
13
        new UserFactory({
14
          entity: User
15
        })
16
      ]
17
    });
18
19
    const customerSeeder = new CustomerSeeder({
20
      factories: [new CustomerFactory()]
21
    });
22
23
    await this.call([userSeeder, customerSeeder]);
24
  }
25
}
26